import {base64ToBlob, canvasToImage} from "../utils";

export default {
    click() {
        this.drawFont(true)//渲染字体
        this.isChange = false;
        this.loading(true);
        var base64 = canvasToImage(this.canvas);
        let blob = base64ToBlob(base64);
        this.preImg = base64;
        this.$emit('save', {
            base64,
            blob,
            canvasRect: this.canvasRect,
            uuid: this.uuid,
            callback: (bool) => {
                if (bool) {
                    this.loading(false);
                    this.isChange = false;
                    this.controlEvent('click', null, 'Close')
                }
            }
        })
    },
    canvasMousedown(e) {
    },
    canvasMouseup(e) {
    },
    canvasMouseout(e) {
    },
    canvasTouchstart(e) {
    },
    canvasTouchend(e) {
    },
    winMouseup() {
    },
    winMousemove(e) {
    },
    winTouchend(e) {
    },
    visibilitychange() {
    }
}

